let lessons = `
js,200元,300次
PHP,300.00元,100次
nodejs,180元,260次
`;

let reg = /(\d+)(.00)?(?=元)/gi;
lessons = lessons.replace(reg, (v, ...args) => {
  // args[0] = 数字
  // args[1] = .00

  args[1] = args[1] || ".00";
  return args.splice(0, 2).join("");
});

console.log(lessons);
